<?php
session_start();
$loginId=$_SESSION['loginid'];
$name=$_SESSION['name'];
$userType=$_SESSION['user_type'];

include_once('connection/connection.php');
include('config.php');
$frm=$_REQUEST['frm'];
$qryMain="select * from tbl_dtls_q2_main where id='$frm'";
$resMain=mysql_query($qryMain);
$rowMain=mysql_fetch_array($resMain);



?>




<body>
<script language="javascript" type="text/javascript" src="js/ajaxFunction_q2_new.js"></script>
<div id="scheme_section5" class="section_format">
  <form action="edit_q2_operational.php" method="post" name="sec5" id="sec5" onSubmit="return sec5_val();">
  <table border="1">
    <tr>
      <td colspan="4"><strong>&nbsp;Operational Aspects
          <input type="hidden" name="frmId" id="frmId" value="<?php echo $frm;?>" />
		  <input type="hidden" name="loginId" id="loginId" value="<?php echo $loginId;?>" />
	  <input type="hidden" name="name" id="name" value="<?php echo $name;?>" />
	  <input type="hidden" name="userType" id="userType" value="<?php echo $userType;?>" />
      </strong></td>
      </tr>
    <tr>
      <td width="378"><strong>&nbsp;Current status of schemes</strong></td>
      <td colspan="3">&nbsp;<input type="radio" name="OA_current_status" id="OA_current_status" value="OPERATIONAL" <?php echo  ($rowMain['OA_current_status']=='OPERATIONAL')?'checked':'';?> >&nbsp; Operational&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="radio" name="OA_current_status" id="OA_current_status" value="DEFUNCT" <?php echo  ($rowMain['OA_current_status']=='DEFUNCT')?'checked':'';?>>&nbsp; Defunct</td>
      </tr>
    <tr>
      <td><strong>&nbsp;Operational Status (Number of months remaining operational)</strong></td>
      <td colspan="3">&nbsp;<input type="radio" name="OA_operational_status" id="OA_operational_status_12" value="12" onClick="trigger_other('OA_operational_status_other','OA_operational_other');" <?php echo  ($rowMain['OA_operational_status']=='12')?'checked':'';?> > 12&nbsp;&nbsp;
					<input type="radio" name="OA_operational_status" id="OA_operational_status_9" value="9" onClick="trigger_other('OA_operational_status_other','OA_operational_other');" <?php echo  ($rowMain['OA_operational_status']=='9')?'checked':'';?>> 9&nbsp;
					<input type="radio" name="OA_operational_status" id="OA_operational_status_6" value="6" onClick="trigger_other('OA_operational_status_other','OA_operational_other');" <?php echo  ($rowMain['OA_operational_status']=='6')?'checked':'';?>> 6&nbsp;
					<input type="radio" name="OA_operational_status" id="OA_operational_status_other" value="Other"<?php echo  ($rowMain['OA_operational_status']!=12 && $rowMain['OA_operational_status']!=9 && $rowMain['OA_operational_status']!=6)?'checked':'';?> onClick="trigger_other('OA_operational_status_other','OA_operational_other');" />Others 
	(Specify)&nbsp; </font>
	<input type="text" name="OA_operational_other" id="OA_operational_other" size="21" class="txt5" value="<?php if($rowMain['OA_operational_status']!=12 && $rowMain['OA_operational_status']!=9 && $rowMain['OA_operational_status']!=6){ echo $rowMain['OA_operational_status'];$dis="";} else { echo '';$dis="disabled";}?>" onBlur="exist(this);float(this)" <?php echo $dis;?>></td>
      </tr>
    <tr>
      <td><strong>&nbsp;Annual Operation &amp; Maintenance Cost (In <img src="images/26rup1.jpg" width="10"> Lakh)</strong></td>
      <td width="127">&nbsp;FY 2009 - 10 </td>
      <td width="124">&nbsp;FY 2008 - 09</td>
      <td width="123">&nbsp;FY 2007 - 08</td>
    </tr>
    <tr>
      <td><strong>&nbsp;Man Power Cost &amp; Maintenance Cost (In <img src="images/26rup1.jpg" width="10"> Lakh)</strong></td>
      <td>&nbsp;<input type="text" name="manpower_cost_09_10" id="manpower_cost_09_10" size="20" class="txt5"  onBlur="float2dec(this)" value="<?php echo $rowMain['manpower_cost_09_10'];?>" ></td>
      <td>&nbsp;<input type="text" name="manpower_cost_08_09" id="manpower_cost_08_09" size="20" class="txt5" onBlur="float2dec(this)" value="<?php echo $rowMain['manpower_cost_08_09'];?>" ></td>
      <td>&nbsp;<input type="text" name="manpower_cost_07_08" id="manpower_cost_07_08" size="30" class="txt5" onBlur="float2dec(this)" value="<?php echo $rowMain['manpower_cost_07_08'];?>" ></td>
    </tr>
	  <tr>
      <td><strong>&nbsp;Material Cost - Repairs&amp; Maintenance Cost (In <img src="images/26rup1.jpg" width="10"> Lakh)</strong></td>
      <td>&nbsp;<input type="text" name="material_cost_09_10" id="material_cost_09_10" size="20" class="txt5" onBlur="float2dec(this)" value="<?php echo $rowMain['material_cost_09_10'];?>" ></td>
      <td>&nbsp;<input type="text" name="material_cost_08_09" id="material_cost_08_09" size="20" class="txt5"   onBlur="float2dec(this)" value="<?php echo $rowMain['material_cost_08_09'];?>" ></td>
      <td>&nbsp;<input type="text" name="material_cost_07_08" id="material_cost_07_08" size="30" class="txt5" onBlur="float2dec(this)" value="<?php echo $rowMain['material_cost_07_08'];?>" ></td>
	  </tr>
	   <tr>
      <td><strong>&nbsp;Preventive Maintenance Mechanisms in Place</strong></td>
      <td colspan="3">&nbsp;<input type="radio" name="maintenence_machanism" id="maintenence_machanism" value="yes" <?php echo  ($rowMain['maintenence_machanism']=='yes')?'checked':'';?> >
						Yes&nbsp;
				        <input type="radio" name="maintenence_machanism" id="maintenence_machanism" value="no" <?php echo  ($rowMain['maintenence_machanism']=='no')?'checked':'';?>>
			          NO&nbsp;</td>
      </tr>
	   <tr>
	     <td colspan="4">&nbsp;</td>
      </tr>
	   <tr>
	     <td colspan="4"><strong>&nbsp;Complaints Redressal Mechanism</strong></td>
      </tr>
	   <tr>
	     <td><strong>&nbsp;1. Existing Reporting system </strong></td>
	     <td colspan="3"><?php
						$exist_report=explode(',',$rowMain['existing_reporting_system']);
						$a_exit=array('By-phone','Writing','Personal-Contact','Call-Center','Other');
						$exist_other=array_diff($exist_report,$a_exit);
						foreach($exist_other as $key=>$val_exist)
						$other=substr($val_exist, 5);
						//$count=count($exist_report);
						//echo $exist_report[1];
						//for($i=0;$i<=$count;$i++)
						//{
						?>
			        <input type="checkbox" name="exist_report_sys[]" id="exist_report_sys[]" value="By-phone"<?php echo  (in_array('By-phone',$exist_report)?'checked':'');?> >&nbsp;&nbsp;By-phone<br />
				      <input type="checkbox" name="exist_report_sys[]" id="exist_report_sys[]" value="Writing"<?php echo  (in_array('Writing',$exist_report)?'checked':'');?>>&nbsp;&nbsp;Writing<br />
				      <input type="checkbox" name="exist_report_sys[]" id="exist_report_sys[]" value="Personal-Contact"<?php echo  (in_array('Personal-Contact',$exist_report)?'checked':'');?>>&nbsp;&nbsp;Personal-Contact<br />
					  <input type="checkbox" name="exist_report_sys[]" id="exist_report_sys[]" value="Call-Center"<?php echo  (in_array('Call-Center',$exist_report)?'checked':'');?>>&nbsp;&nbsp;Call Center<br />
				      <input type="checkbox" name="exist_report_sys[]" id="exist_report_sys_other" value="Other"<?php echo  ($other!='')?'checked':'';?> onClick="trigger_other('exist_report_sys_other','report_other');" />&nbsp;&nbsp;Other &nbsp;&nbsp;
					  <input type="text" name="report_other" id="report_other" value="<?php echo  $other;?>" <?php echo ($other=="")?"disabled":""; ?>>		</td>
      </tr>
	   <tr>
	     <td><strong>&nbsp;2. Time Taken to address the complaint (In hrs.)</strong></td>
	     <td colspan="3">&nbsp;
	       <select size="1" name="time_taken" id="time_taken" class="txt" >
             <option selected value="0">Select Day</option>
             <?php 
						foreach($time as $key=>$val)
						{
		   					//echo "<option value=$val>$val</option>";
							if($rowMain['time_taken']==$val)
							{
		   						echo "<option value=$val selected>$val</option>";
							}
							else
							{
								echo "<option value=$val>$val</option>";
							}
						}
						?>
           </select></td>
      </tr>
	   <tr>
	     <td colspan="4">&nbsp;</td>
      </tr>
	   <tr>
	     <td colspan="4"><strong>&nbsp;Constraint / Issues 
			Faced by PHED officials</strong></td>
      </tr>
	   <tr>
	     <td colspan="4">&nbsp;</td>
      </tr>
		 <?php 
					$exist_inst=explode(',',$rowMain['constraint_institutional']);
					?>
	   <tr>
	     <td valign="top"><strong>&nbsp;Institutional</strong></td>
	     <td colspan="3"><input type="checkbox" name="institutional[]" id="institutional[]" value="Procedural Delays"<?php echo  (in_array('Procedural Delays',$exist_inst)?'checked':'');?>>Procedural Delays<br />
		 <input type="checkbox" name="institutional[]" id="institutional[]" value="Needs Streamlining of procedures"<?php echo  (in_array('Needs Streamlining of procedures',$exist_inst)?'checked':'');?>>Needs Streamlining of procedures&nbsp;<br />
		 <?php
				  $a_inst=array('Procedural Delays','Needs Streamlining of procedures');
						$exist_instutional=array_diff($exist_inst,$a_inst);
						foreach($exist_instutional as $key=>$val_inst)
						//echo $val;
						//$other=substr($val, 5);
						?>
						<input type="checkbox" name="institutional[]" id="institutional_other_check" value=""<?php echo  ($val_inst!='')?'checked':'';?> onClick="trigger_other('institutional_other_check','institutional_other');">Others 
	(Specify)<br />&nbsp; <input type="text" name="institutional_other" id="institutional_other" size="31" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px" value="<?php echo $val_inst;?>" <?php echo ($val_inst=="")?"disabled":""; ?>/>		 </td>
      </tr>
	   <tr>
	     <td valign="top"><strong>&nbsp;Financial</strong></td>
	     <td colspan="3">
		 <?php 
					$exist_fin=explode(',',$rowMain['constraint_financial']);
					$a_fin=array('Financial constraints at operational level');
						$exist_financial=array_diff($exist_fin,$a_fin);
						foreach($exist_financial as $key=>$val_fin)
					?>
					<input type="checkbox" name="financial[]" id="financial[]" value="Financial constraints at operational level"<?php echo  (in_array('Financial constraints at operational level',$exist_fin)?'checked':'');?>>Financial constraints at operational level<br />
					<input type="checkbox" name="financial[]" id="financial_other_check" value=""<?php echo  ($val_fin!='')?'checked':'';?> onClick="trigger_other('financial_other_check','financial_other');">Others 
	(Specify)<br />&nbsp;
	<input type="text" name="financial_other" id="financial_other" value="<?php echo $val_fin;?>" size="31" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px" <?php echo ($val_fin=="")?"disabled":""; ?> />		 </td>
      </tr>
	   <tr>
	     <td valign="top"><strong>&nbsp;Operational</strong></td>
	     <td colspan="3"><?php 
					$exist_opt=explode(',',$rowMain['constraint_operational']);
					$a_opt=array('Manpower Shortage','Lack Vehicles for movement','Shortages of Spares');
						$exist_operational=array_diff($exist_opt,$a_opt);
						foreach($exist_operational as $key=>$val_opt)
					?>
					<input type="checkbox" name="operational[]" id="operational[]" value="Manpower Shortage"<?php echo  (in_array('Manpower Shortage',$exist_opt)?'checked':'');?>>Manpower Shortage<br />
					<input type="checkbox" name="operational[]" id="operational[]" value="Lack Vehicles for movement"<?php echo  (in_array('Lack Vehicles for movement',$exist_opt)?'checked':'');?>>Lack Vehicles for movement<br />
					<input type="checkbox" name="operational[]" id="operational[]" value="Shortages of Spares"<?php echo  (in_array('Shortages of Spares',$exist_opt)?'checked':'');?>>Shortages of Spares<br />
					<input type="checkbox" name="operational[]" id="operational_other_check" value=""<?php echo  ($val_opt!='')?'checked':'';?> onClick="trigger_other('operational_other_check','operational_other');">Others (Specify) <br />&nbsp;
	<input type="text" name="operational_other" id="operational_other" size="31" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px" value="<?php echo $val_opt;?>" <?php echo ($val_opt=="")?"disabled":""; ?> />		 </td>
      </tr>
	   <tr>
	     <td colspan="4">&nbsp;</td>
      </tr>
		 <tr>
	    <td colspan="4" align="center"><input type="submit" value="EDIT" name="submit" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px; font-weight:bold; background:#666666; color:#FFFFFF; width:140px; height:30px" onClick="view_validate()"></td>
  </tr>
  </table>
 </form>
</div>
</body>
